{include file="public/header" /}
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong><span class="icon-key"></span>添加权限组 </strong></div>
  <div class="body-content">
    <form id="form" method="post" class="form-x" action="">
	 <div class="form-group">

      <div class="form-group">
        <div class="label">
          <label for="sitename">权限组名：</label>
        </div>
        <div class="field">
          <label style="line-height:33px;">
          <input type="text" class="input w50" name="role_name" value=""  data-validate="required:权限组名不能为空" />
          </label>
        </div>
      </div>      
     
  <div class="form-group">
        <div class="label">
          <label for="sitename">级别：</label>
        </div>
        <div class="field">
          <label style="line-height:33px;">
          <textarea class="input" name="remark" style=" height:60px;"></textarea>
          </label>
        </div>
      </div> 
       
       <div class="form-group">
        <div class="label">
          <label for="sitename">状态：</label>
        </div>
        <div class="field">
          <label style="line-height:33px;">
          <input type="radio" name="status" value="1" checked> 启用 &nbsp;&nbsp;
          <input type="radio" name="status" value="0"> 禁用
          </label>
        </div>
      </div>  
        
      
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <a class="button bg-main icon-check-square-o" onclick="submit()"> 提交</a>
        </div>
      </div>      
    </form>
  </div>
 </div>
<script>
    function submit(){
        var data=new FormData($("#form")[0]);
        $.ajax({
            type:"post",
            url:"{:U('AdminRole/add')}",
            data:data,
            dataType:"json",
            processData:false,
            contentType:false,
            cache:false,
            success:function(rs){
                if(rs.res==1 && rs.data.url!= undefined){
                    layer.msg(rs.msg, {icon:1}, function(){
                        window.location=rs.data.url;
                    });
                }else{
                    layer.msg(rs.msg);
                }
            }
        });
    }
</script>
{include file="public/footer" /}